<?php
use \yesf\Yesf;
$baseUri = Yesf::getBaseUri();
?>
<!DOCTYPE html>
<html>
<head>
	<title>添加用户 - EasyAccount</title>
	<?=$this->render('common/header')?>
</head>
<body class="fixed-nav bg-dark">
	<?=$this->render('common/navbar')?>
	<div class="content-wrapper">
	  	<div class="container-fluid">
			<h1>添加用户</h1>
			<div class="card">
				<div class="card-header">单个添加</div>
				<div class="card-body">
					<form id="addform" method="post" onsubmit="return false;">
						<div class="form-group row">
							<label for="form-name" class="col-sm-2 col-form-label">类型</label>
							<div class="col-sm-10">
								<select id="form-role" class="form-control" name="role">
									<option value="0">普通用户</option>
									<option value="1">管理员</option>
								</select>
							</div>
						</div>
						<div class="form-group row">
							<label for="form-group" class="col-sm-2 col-form-label">用户组</label>
							<div class="col-sm-10"><select id="form-group" class="form-control" name="group"></select></div>
						</div>
						<div class="form-group row">
							<label for="form-nickname" class="col-sm-2 col-form-label">昵称</label>
							<div class="col-sm-10"><input id="form-nickname" class="form-control" type="text" name="nickname" required></div>
						</div>
						<div class="form-group row">
							<label for="form-mail" class="col-sm-2 col-form-label">EMail</label>
							<div class="col-sm-10"><input id="form-mail" class="form-control" type="email" name="mail" required></div>
						</div>
						<div class="form-group row">
							<label for="form-password" class="col-sm-2 col-form-label">密码</label>
							<div class="col-sm-10"><input id="form-password" class="form-control" type="text" name="password" required></div>
						</div>
						<div class="form-group row">
							<label for="form-avatar" class="col-sm-2 col-form-label">头像地址</label>
							<div class="col-sm-10"><input id="form-avatar" class="form-control" type="url" name="avatar"></div>
						</div>
						<div class="form-group row">
							<div class="col-sm-2"></div>
							<div class="col-sm-10"><button type="submit" class="btn btn-primary">添加</button></div>
						</div>
					</form>
				</div>
			</div>
			<div class="card">
				<div class="card-header">批量导入 <a href="<?=$baseUri?>assets/import.xls" target="_blank">下载模板</a></div>
				<div class="card-body">
					<form id="importform" method="post" onsubmit="return false;" enctype="multipart/form-data">
						<div class="form-group row">
							<label for="form-file" class="col-sm-2 col-form-label">选择xls/xlsx文件</label>
							<div class="col-sm-10"><input id="form-file" type="file" name="file" accept=".xls;.xlsx"></div>
						</div>
						<div class="form-group row">
							<div class="col-sm-2"></div>
							<div id="import_status" class="col-sm-10"></div>
						</div>
						<div class="form-group row">
							<div class="col-sm-2"></div>
							<div class="col-sm-10"><button type="submit" class="btn btn-primary">上传</button></div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!-- end right Content here -->
	</div>
	<script>window.ea.page="user_add";</script>
	<?=$this->render('common/footer')?>
</body>
</html>